import {createRouter,createWebHistory} from 'vue-router'

import LoginVue from '@/views/Login.vue';
import LayoutVue from '@/views/Layout.vue';

import ArticleCategoryVue from '@/views/article/ArticleCategory.vue';
import ArticleManageVue from '@/views/article/ArticleManage.vue';

import UserAvatarVue from '@/views/user/UserAvatar.vue';
import UserInfoVue from '@/views/user/UserInfo.vue';
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue';

import Home from '@/views/Home.vue';
import ForgetPwdVue from '@/views/ForgetPwd.vue';

import test from '@/views/com.vue';
import test1 from '@/components/test.vue'

import ArticleCheck from '@/views/article/ArticleCheck.vue'

const routes = [
  {path:'/login',component:LoginVue},
  {path:'/',component:LayoutVue, redirect:'/home', children:[
    {path:'/article/category', component: ArticleCategoryVue},
    {path:'/article/manage', component: ArticleManageVue},
    {path:'/user/avatar', component: UserAvatarVue},
    {path:'/user/info', component: UserInfoVue},
    {path:'/user/resetPassword', component: UserResetPasswordVue},
    {path: '/home',name: 'Home',component: Home},
    {path: '/test', component: test},
    {path: '/test1', component: test1},
    {
      path: '/article/:id',
      name: 'ArticleDetail',
      component: ArticleCheck
    }
  ]},
  {path:'/forget', component: ForgetPwdVue},

]

const router = createRouter({
  history:createWebHistory(),
  routes: routes
})

export default router